module.exports = {
	setToken: function(data) {
		uni.setStorageSync("token", data);
	},
	setTokenExpiresTime: function(data) {
		uni.setStorageSync("tokenExpiresTime", data);
	},
	setUserInfo: function(data) {
		uni.setStorageSync("userId", data.userId);
		uni.setStorageSync("userInfo", data);
	},
	getToken: function() {
		return uni.getStorageSync("token");
	},
	getTokenExpiresTime: function() {
		return uni.getStorageSync("tokenExpiresTime");
	},
	getUserId: function() {
		return uni.getStorageSync("userId");
	},
	getUserInfo: function() {
		return uni.getStorageSync("userInfo");
	},
	/**
	 * 退出登陆
	 */
	exitLogin: function() {
		uni.removeStorageSync('token');
		uni.removeStorageSync('tokenExpiresTime');
		uni.removeStorageSync('userId');
		uni.removeStorageSync('userInfo');
	}
}
